#pragma once
#include "WindowManager.h"
#include "SpritesHolder.h"

class Game
{
public:
	Game();
	~Game();
	static Game* instance; 

	int gameIsRunning; 
	
	SDL_Texture* _backgroundSurface;

	bool GameInit();
	void GameLoop();
	void GameUpdate();
	void GameDraw();
	void GameEnd();
	void GameQuit();

private:
	SpritesHolder *_sprites;

	WindowManager* _windowManager;
	SDL_Renderer* _renderer;
	Uint32 _endFrame_timeElapsed;
	short _FPS;
	Uint32 _sleepTime; 
	Uint32 _gameTime; 

	bool _InitWindowManager();
	bool _ReadGameConfiguration();
	bool _InitBox2D();
	bool _LoadResources();
	bool _CreateSprites();

	void _GetUserInput();
	void _HandleKeys(SDL_Event*);
	void _UpdatePlayer();
	void _UpdateBullets();
	void _UpdateEnemies();

	void _GameClearSurface();
	void _GamePutToScreen();
	
};

